package gof23.create.builder;

import java.util.HashMap;
import java.util.Map;

/**
 * 服务员（指挥官）
 * @author zhiyizha
 *
 */
public class DrinksWaiter {
	
	public enum Item{Cola,MilkyTea}
	
	private static Map<Item,DrinksBuilder> drinksBuliderMap = new HashMap<>();
	
	static{
		drinksBuliderMap.put(Item.Cola, new ColaBuilder());
		drinksBuliderMap.put(Item.MilkyTea, new MilkyTeaBuilder());
	}
	
	
	public Drinks getDrinks(Item item,boolean addIce,boolean addSugar){
		DrinksBuilder drinksBulider = drinksBuliderMap.get(item);
		drinksBulider.setName();
		if(addIce){
			drinksBulider.addIce();
		}
		if(addSugar){
			drinksBulider.addSugar();
		}
		return drinksBulider.getDrinks();
		
	}
}
